const http = require('http')
const path = require('path')
const fs = require('fs')

// 根目录  / => 服务器中的地址
const webRoot = path.resolve('./www')

http.createServer((req, res) => {
  fs.createReadStream(path.join(webRoot, 'ps_3000.html')).pipe(res)
}).listen(3000, () => console.log('http://localhost:3000'))